from demo1 import app
from celery.result import AsyncResult
id='e0daa2e7-8633-4588-9480-f4d67fa8508e'
async_result=AsyncResult(id='e0daa2e7-8633-4588-9480-f4d67fa8508e',app=app)
if async_result.successful():
    result=async_result.get()
    print('任务执行成功.')
    print(f'任务ID:{id}结果为:{result}')
elif async_result.failed():
    print('执行失败')
elif async_result.status =='PENDING':
    print('任务等待被执行')
elif async_result.status == 'RETRY':
    print('任务等待被重新执行')
elif async_result.status == 'STARTED':
    print('任务已经开始被执行')